January 26, 2018
What is R Markdown
- R Markdown is a file format for making dynamic documents with R
- A mix text and R code together in one document
- Knit the document = execute code and compile the document
- A text file that can be tracked by git
- User-friendly (compared to LaTeX) but still powerful
- Written in markdown, but can include HTML, LaTeX and R code
What is R Markdown
Why R Markdown?
- Reproducable research
- Mouse clicking is not reproducable
- Copying and pasting R output from text files to documents is not reproducable
You when you start your project:
Why R Markdown?
- Reproducable research
- Mouse clicking is not reproducable
- Copying and pasting R output from text files to documents is not reproducable
After getting the second round of revisions back:
Why R Markdown?
- Reproducable research
- Mouse clicking is not reproducable
- Copying and pasting R output from text files to documents is not reproducable
- A work flow that forces me to make things more reproducable
Why R Markdown?
- Version control
- text file that can be tracked by git
Why R Markdown?
- Version control
- text file that can be tracked by git
- this is embarrassing
"
Why this work flow?
- One of many possible work flows to achieve those goals - knitr, sweave, latex with a master script
- Anything to avoid clicking the mouse
- Choose whatever works for you!
Why this work flow?
- rmarkdown is:
- easy to learn with lots of support from RStudio
- able to include LaTeX or HTML code
- creates PDF and HTML output (and Word)
- keep the tex file for journal submission
Some things could be better
- including journal templates
- this cats jumping skills
Cool features
- Everything is in one document
- Call external scripts
- Caching
- Make PDF or HTML presentations (beamer, isolides, slidy)
- Easy to include:
- references
- equations
- lists
- figures
- cross-references
- tables
- actual r code